Basic Functions


The typical function has syntax:
Function("parameter1","parameter2")

There are functions with zero, one or two parameters. The parameters in many cases could be replaced by string variables, the syntax however stays the same: Function("variable$","variable$")

Hide("OBJECT")

Hide object or a group of objects

Show("OBJECT")

Show object or a group of objects. If you show animated gif the gif will start animate from the first frame.

Invert("OBJECT")

Show or hide object or group of objects. If the object/group was visible before this will hide it and opposite.

Click here to see an example.

VideoPlay("VIDEO OBJECT")
VideoStop("VIDEO OBJECT")

Play and stop video(AVI) object

RunMBD("PATH TO MBD","PAGE LABEL")

Run another mbd project in the same window. You can specify a Page where the new project will start û but you donÆt have to.
This is very important command for creating big applications. You will put different blocks to separate mbd files and instead of moving between pages you will move between files.
This allows you to make really big multimedia without memory problems û the old project is deleted from memory as soon as new one is loaded.
Also if you using Full Screen Background (Kiosk)û this allows you to change the background bitmap jumping to another file and loading the background from there.
DonÆt forgot to use <SrcDir> in the path !

Run("PATH","PARAMETERS")

Run external programs. You can run file viewers, setup utilities etc..
In addition, you can run another mbd project in different window. Even if you create stand alone file (autorun.exe) û call the same file with another mbd file as a parameter.
Run("<SrcDir>\autorun.exe", "<SrcDir>\otherfile.mbd").
This will pen another project in different window û with different size and settings)

MMB4.9.0.1 To brings application window on top/topmost level you can use the additional TOP and TOPMOST flags. What is a real difference between these flags?
TOP parameter will assure, that the application will always start on top of the source application, but after click on another window (or source mbd/exe window) it will be moved to the background.
TOPMOST parameter will force the running application stay on top the source application and most of already running applications.

To open notepad TOPMOST over all applications use this code:
Run("<Windows>\notepad.exe","TOPMOST")

To run notepad TOPMOST over all windows and open an your document use this line:
Run("<Windows>\notepad.exe","TOPMOST C:\myDoc.txt")

In addition, if the TOP/TOPMOST flags are used, then MMB will always wait until the application initialize (an infinite time). It can be potentially dangerous in cases when the external application cannot start (from any reason), because it can freeze the MMB completely. Therefore, there is an option to set a timeout value to continue with MMB application after a number of milliseconds, no matter if the external application is already initialized or not.

Example:
Run("<Windows>\notepad.exe","TOPMOST(2000) C:\myDoc.txt")

New in 4.9.5

Added new WAIT parameter. This will cause waiting the MMB application until external application is running. It's usefull in cases when you need to run an external application from MMB and then you want to wait until the application exit.

Example:
Run("<Windows>\notepad.exe","WAIT")

or more advanced example in combination with TOPMOST flag:
Run("<Windows>\notepad.exe","TOPMOST,WAIT c:\your.txt")

KNOWN LIMITATIONS:

FirstPage()
LastPage()
NextPage()
PrevPage()
Page("PAGE LABEL")

Page commands û jumping to different pages within the project.
In the Page command you can specify LASTPAGE instead of page name. This will jump to the last viewed page within the project.

Exit()

Quit the application immediately.

Minimize()

Minimize the application. This is the Minimize button action.

ExitTimer("MILLISEC")

Exit application after number of milliseconds. Be aware the PageTimer will cancel this command. Also clicking on any active object will cancel the command û this is important û you can provide user with button to go back not to exit.
With this command you can wait until sound will play, or display your logo for few seconds etcà

PageTimer("MILLISEC","PAGE")

Got to a page after number of milliseconds. If you donÆt specify the page û the next page will be taken.
You can also use commands instead of page label:

THIS_SCRIPT û will just run the script on the same page
THIS_PAGE û will start the same page again.
IF_IDLE û will go to the next page only if user is waiting. If user click on active object (e.g. button), the app will not go to next page.

The difference is û page start will put all objects to its default stage and it will look also for background music û and then it will run the script.

Important:

With this, you can make the self-running presentation û if user doesnÆt click on anything in few minutes MMB will go to the next page. If user clicks on some active object, the page timer will be canceled (User wants to stay on the page) and is up to you if you will leave it like that or start PageTimer again on Button click. For example, you can make the portfolio show, where each item  is on different page and if user wants to stop the show he will just press the button Pause.

The sample application with an example of THIS_SCRIPT and IF_IDLE optional commands, see the ifidle_pagetimer.mbd in Samples folder.

DisplayValue("TEXTOBJECT","VARIABLE")

Display an integer part of the variable in some text object. Good for counters etcà

Message("ANYSTRING","VARIABLE")

Mostly for debugging. You can make pop-up the message with an integer value of some variable.

LoadText("TEXTOBJECT","VARIABLE")

This command can load a text into text object (Paragraph Text, Text, Text Button) from String variable or file.  The command decides itself if the text in variable is just a plain text or it points to the file. It can expand the string to full path as well.

Click here to see an example.

Return()

Return from executing the script. You can use it in if û end statement.

AGifPlay("ANIGIF OBJECT")
AGifStop("ANIGIF OBJECT")
AGifReset("ANIGIF OBJECT")

Animated Gifs commands. The play will play anigif from the actual frame, the stop will stop the animation.
The reset will set the actual frame to the first frame. How the anigif will animate depends on the Anigif properties.

RunScript("OBJECT")

Run script of some other object.
The best would be to run Script Object script so you can build some kind of global functions. However, you can run script from any object û the Mouse Up script will run.

You can run the same script û and you will create recursive calls. Unless you are sure what you are doing donÆt use recursion.

ScriptTimer("OBJECT","MILISEC")

Run script on object or Script object after a number of milliseconds. (See RunScript). Good for hiding some message after few seconds etcà

MCICommand("MCI STRING")

This will send a string to a device. The string will tell the device what to do.
With this command you can access the devices for playing MPEG, video discs, record sound, play animation etc..
You can use <SrcDir>, <Src Drive> or <CD> in the string.
Also use <This> with the parent command to tell the device the MMB window will be the parent.
For detailed information about the possible MCI strings, please, refer to the Mcistr.hlp documentation included in MMB root folder.

Click here to see an example.

OpenFile("FILTER", "DEFAULT")

Opens The File Open Dialog Box. The selected file will modify <File> shortcut and OpenFile$ string variable as well as CBK_OpenFile and CBK_OpenDir variables.

Click here to see an example.

FileString("SUBSTRING","VARIABLE")

Use after OpenFile
Searches <File> string for the first match of a substring.
You put the substring (for example): .wav
If the <File> has substring '.wav' in its string the variable (Second Parameter) will become 1

Click here to see an example.

InstallFont("FontFile")

If you using some font which user might not have on his system û it will be substituted with other font û thatÆs not the effect you would like.
Using InstallTTF you can temporary install your font on users computer. This font will be uninstalled after you exit the application. The example: Put your funny.ttf font on the distribution CD and on the beginning of the application call: InstalFont("<SrcDir>\funny.ttf")

You can use Embedded Font.

Clipboard("SEND/GET","stringvariable$")

SEND or GET string variable to/from clipboard.

FileExist("PATH TO FILE","VARIABLE")

Tests if external file exists. If yes the VARIABLE will get value 1 else 0

Sound & CD Commands

SaveVariable/LoadVariable

Print Commands

Text-To-Speech Commands

Song List Commands

External Image Commands

Image Matrix Commands

Plugins and Plugin Commands

SysCommand

Animation Commands